package hummer.process;

import hummer.domain.Hummer;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 14-8-24
 * Time: 下午10:34
 * To change this template use File | Settings | File Templates.
 */
public class ProcessDispather {

    private Hummer hummer;
    private long timeout = 15000L;
    /**
     * 线程池大小
     */
    private int poolSize;

    private ExecutorService executorService;

    private ExecutorService getExecutorService() {

        if (executorService == null) {

            if (poolSize == 0) {

                executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1);

            } else {

                executorService = Executors.newFixedThreadPool(poolSize);

            }

        }
        return executorService;
    }

}
